<? if(!$GLOBALS['USER']->IsAuthorized()):?>
<div class="container-head"><?=t('Authorize')?></div>
<form method="post">
    <?
    check_session();
    set_action('singin');
    ?>
    <div class="formfield">
        <label for="login"><?= t('Login') ?></label>
        <input type="text" name="login" value="<?= (isset($_POST['login']) ? $_POST['login'] : "") ?>">
    </div>
    <div class="formfield">
        <label for="pass"><?= t('Pass') ?></label>
        <input type="password" name="pass" value="">
    </div>
    <div class="formfield">        
        <input type="checkbox" name="store"><label for="store"><?= t('Remember me') ?></label>
        <input type="submit" value="<?= t('Singin') ?>"><div class="clear"></div>
    </div>
</form>
<? else: ?>

<form method="post">
    <div class="container-head"><?=t('Welcome').", ".$result['login']."."?>
    <input type="submit" class="container-head-corner-button" value="<?= t('Exit') ?>"></div>
    <?
    check_session();
    set_action('singout');
    ?>
    <? $GLOBALS['MAIN']->Controller('system.user_card')?>
</form>
<? endif; ?>